package com.xr.miniprogram.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xr.miniprogram.domain.vo.MiniProgramMenuTree;
import lombok.Data;

/**
 * 小程序菜单
 */
@TableName("mp_menu")
@Data
public class MiniProgramMenu {
    @TableId(type = IdType.AUTO)
    private Long menuId;
    private String menuName;
    private Long parentId;
    private Long menuLeave;//节点等级

    /**
     *  展示位置
     */
    private int showNum;//展示位置
    private int isSuggest;//是否推荐
    private String description;

    public  MiniProgramMenuTree toMiniProgramMenuTree(){
        MiniProgramMenuTree miniProgramMenuTree = new MiniProgramMenuTree();
        miniProgramMenuTree.setMenuId(this.getMenuId());
        miniProgramMenuTree.setMenuName(this.getMenuName());
        miniProgramMenuTree.setMenuLeave((long)this.getMenuLeave());
        miniProgramMenuTree.setParentId(this.getParentId());
        miniProgramMenuTree.setIsSuggest((long) this.getIsSuggest());
        miniProgramMenuTree.setShowNum((long) this.getShowNum());
        miniProgramMenuTree.setDescription(this.getDescription());
        return miniProgramMenuTree;
    }

}
